package
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	
	public class Test10 extends Sprite
	{
		public function Test10()
		{
			var loader1:Loader = new Loader();
			loader1.load(new URLRequest("ui1.swf"));
			addChild(loader1);
			loader1.contentLoaderInfo.addEventListener(Event.COMPLETE,complete1Handler);
			
			var loader2:Loader = new Loader();
			loader2.load(new URLRequest("ui2.swf"));
			addChild(loader2);
			loader2.contentLoaderInfo.addEventListener(Event.COMPLETE,complete2Handler);
			
		}
		
		private function complete1Handler(e:Event):void
		{
			var mc1:MovieClip = new (e.target.applicationDomain.getDefinition("mc1") as Class);
			addChild(mc1);
			mc1.gotoAndStop(1);
			mc1.buttonMode = true;
			
			var mc2:MovieClip = new (e.target.applicationDomain.getDefinition("mc2") as Class);
			addChild(mc2);
			mc2.gotoAndStop(1);
			mc2.buttonMode = true;
			mc2.x = 300;
		}
		
		private function complete2Handler(e:Event):void
		{
			var mc1:MovieClip = new (e.target.applicationDomain.getDefinition("mc1") as Class);
			addChild(mc1);
			mc1.x = 200;
			mc1.y = 20;
		}
		
	}
}